<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>

<script>
    $(function () {
        $("#userlist").datagrid({
            url:"${pageContext.request.contextPath}/getUsers",
            pagination:true,
            columns:[[
                {field:'userId',title:'Code',width:100},
                {field:'userTelephone',title:'Name',width:100},
                {field:'userPassword',title:'Price',width:100,align:'right'},
                {field:'userImage',title:'Price',width:100,align:'right'},
                {field:'userNickname',title:'Price',width:100,align:'right'},
                {field:'username',title:'Price',width:100,align:'right'},
                {field:'userSex',title:'Price',width:100,align:'right'},
                {field:'userAutograph',title:'Price',width:100,align:'right'},
                {field:'userProvince',title:'Price',width:100,align:'right'},
                {field:'userCity',title:'Price',width:100,align:'right'},
                {field:'guruId',title:'Price',width:100,align:'right'},
                {field:'userStatus',title:'Price',width:100,align:'right'},
                {field:'userCreateDate',title:'Price',width:100,align:'right'},
                {field:'cz',title:'操作',width:100,
                    formatter: function(value,row,index){
                        return "<a href='javascript:freeze("+row.userId+")'>冻结用户</a>";
                    }
                },
            ]]
        });

    })

    function freeze(id){
        $.ajax({
            url:"${pageContext.request.contextPath}/freeze",
            data:"id="+id,
            success:function(data){
                $.messager.alert('我的消息',data,'info');

                $("#userlist").datagrid("reload");
            }
        });
    }

</script>


<table id="userlist"></table>